<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>领域服务编辑页面</title>
<link href="../../static/css/normalize.css?twitterbutton" rel="stylesheet" type="text/css"/>
<link href="../../static/css/tricks.css?twitterbutton" rel="stylesheet" type="text/css"/>
<link href="../../static/css/elusive-webfont.css?twitterbutton" rel="stylesheet" type="text/css"/>
<link href="../../static/css/codemirror.css?twitterbutton" rel="stylesheet" type="text/css"/>
<link href="../../static/css/screen.css?twitterbutton" rel="stylesheet" type="text/css"/>
<link href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
<link href="../../static/plugi/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
<script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
<script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../static/easyui/jquery.easyui.ext.js" type="text/javascript" charset="utf-8"></script>
<script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
<script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
<script src="../../static/js/libs/jquery.cookie.min.js" type="text/javascript"></script>
<script src="../../alldic.js"></script>
<a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<body class="easyui-layout" style="padding: 10px">
	
	<div data-options="region:'north',border:false"
		style="height: 26px; padding: 0px; overflow: hidden">
        <div style="text-align:left; width:100%;margin: 0 auto;" id="headPanel">
            <div class="tool-panel" style="width: 100%; height: 26px;margin-bottom: 2px;padding:4px;width:100%;background-color: #ebecee">
                <a onclick="javascript:saveTable()" class="easyui-linkbutton" iconCls="icon-ok" plain="true">保存</a>
                <a onclick="validataTable()"  class="easyui-linkbutton" iconCls="icon-ok" plain="true">校验</a>
                <a  class="easyui-linkbutton" iconCls="icon-ok" plain="true">预览</a>
                <span style="color: #40a0ff">模型状态：<span id="validMsg">未校验</span> </span>
            </div>
         </div>
	</div>
	<div data-options="region:'center',title:''" style="overflow-y:auto ;" id="center">
		<div id="inputParameter" class="easyui-tabs" border="false" style="height: 75%;overflow:hidden ;" >
			<div title=" " style="padding:0px;overflow:hidden;" border="false"  fit="true" >
				<!--				<iframe id="centerFrame" name="centerFrame" height="100%" width="100%" frameborder="0" scrolling="auto"></iframe>-->
			</div>
		</div>
<!--		<div id="queryRange" class="easyui-tabs" fit="true" border="false">-->
<!--			<div title=" " style="padding:0px" border="false" fit="true">-->
<!--				&lt;!&ndash;				<iframe id="centerFrame" name="centerFrame" height="100%" width="100%" frameborder="0" scrolling="auto"></iframe>&ndash;&gt;-->
<!--			</div>-->
<!--		</div>-->
		<div id="queryCondition" class="easyui-tabs" style="height: 75%;overflow:hidden ;" border="false">
			<div title=" " style="padding:0px" border="false" fit="true">
				<!--				<iframe id="centerFrame" name="centerFrame" height="100%" width="100%" frameborder="0" scrolling="auto"></iframe>-->
			</div>
		</div>
		<div id="deleteCondition" class="easyui-tabs" style="height: 75%;overflow:hidden ;" border="false">
			<div title=" " style="padding:0px" border="false" fit="true">
				<!--				<iframe id="centerFrame" name="centerFrame" height="100%" width="100%" frameborder="0" scrolling="auto"></iframe>-->
			</div>
		</div>
		<div id="modifyCondition" class="easyui-tabs" style="height: 75%;overflow:hidden ;" border="false">
			<div title=" " style="padding:0px" border="false" fit="true">
				<!--				<iframe id="centerFrame" name="centerFrame" height="100%" width="100%" frameborder="0" scrolling="auto"></iframe>-->
			</div>
		</div>
		<div id="dataCleaning" class="easyui-tabs" style="height: 75%;overflow:hidden ;" border="false">
			<div title=" " style="padding:0px" border="false" fit="true">
				<!--				<iframe id="centerFrame" name="centerFrame" height="100%" width="100%" frameborder="0" scrolling="auto"></iframe>-->
			</div>
		</div>
		<div id="outputParameter" class="easyui-tabs" style="height: 75%;overflow:hidden ;" border="false">
			<div title=" " style="padding:0px" border="false" fit="true">
				<!--				<iframe id="centerFrame" name="centerFrame" height="100%" width="100%" frameborder="0" scrolling="auto"></iframe>-->
			</div>
		</div>
	</div>
</body>
</html>
<script>
	var appId = $.getUrlParam('appId');
	var appModelId = $.getUrlParam('appModelId');
	var appModelType = $.getUrlParam('appModelType');
	var appModelName = $.getUrlParam('appModelName');
	var appModelTypeName = $.getUrlParam('appModelTypeName');
	var packageName = $.getUrlParam('packageName');
	var topWin = window;
	var existsEmptyWin = true;
	function addTab(title, url,tabId){
		if(existsEmptyWin) {
			$("#"+tabId).tabs('close', ' ');
			existsEmptyWin = false;
		}
		if ($("#"+tabId).tabs('exists', title)){
			$("#"+tabId).tabs('select', title);
		} else {
			var content = '<iframe scrolling="no" frameborder="0" src="'+url+'" style="width:100%;height:97%;"></iframe>';
			$("#"+tabId).tabs('add',{
				title:title,
				content:content,
				closable:false
			});
		}
	}
	function closeTab(title) {
		if ($('#tt').tabs('exists', title)) {
			$('#tt').tabs('close', title)
		}
	}
	//编辑或查看类型
	var readonly = $.getUrlParam('readonly');
	readonly = !!readonly;
	// -- I0101 查询
	// -- I0102 新增
	// -- I0103 修改
	// -- I0104 删除
	// -- I0105 单条
	//控制树菜单
	function optionControl(appModelType){
		var queryCondition = document.getElementById("queryCondition");
		var deleteCondition = document.getElementById("deleteCondition");
		var modifyCondition = document.getElementById("modifyCondition");
		var dataCleaning = document.getElementById("dataCleaning");
		addTab("输入参数",`IsrvInInfoList.html?appId=${appId}&appModelId=${appModelId}&appModelType=${appModelType}&readonly=${readonly}`,"inputParameter");
		switch (appModelType){
			case "I0101":
				deleteCondition.parentNode.removeChild(deleteCondition);
				modifyCondition.parentNode.removeChild(modifyCondition);
				addTab("查询条件",`IsrvCondInfoList.html?appId=${appId}&appModelId=${appModelId}&appModelType=${appModelType}&readonly=${readonly}`,"queryCondition");
				addTab("数据清洗",`IsrvTranInfoList.html?appId=${appId}&appModelId=${appModelId}&appModelType=${appModelType}&readonly=${readonly}`,"dataCleaning");
				break;
			case "I0102":
				// queryRange.parentNode.removeChild(queryRange);
				queryCondition.parentNode.removeChild(queryCondition);
				deleteCondition.parentNode.removeChild(deleteCondition);
				modifyCondition.parentNode.removeChild(modifyCondition);
				addTab("数据清洗",`IsrvTranInfoList.html?appId=${appId}&appModelId=${appModelId}&appModelType=${appModelType}&readonly=${readonly}`,"dataCleaning");
				break;
			case "I0103":
				// queryRange.parentNode.removeChild(queryRange);
				queryCondition.parentNode.removeChild(queryCondition);
				deleteCondition.parentNode.removeChild(deleteCondition);
				addTab("修改条件",`IsrvCondInfoList.html?appId=${appId}&appModelId=${appModelId}&appModelType=${appModelType}&readonly=${readonly}`,"modifyCondition");
				addTab("数据清洗",`IsrvTranInfoList.html?appId=${appId}&appModelId=${appModelId}&appModelType=${appModelType}&readonly=${readonly}`,"dataCleaning");
				break
			case "I0104":
				// queryRange.parentNode.removeChild(queryRange);
				queryCondition.parentNode.removeChild(queryCondition);
				modifyCondition.parentNode.removeChild(modifyCondition);
				dataCleaning.parentNode.removeChild(dataCleaning);
				addTab("删除条件",`IsrvCondInfoList.html?appId=${appId}&appModelId=${appModelId}&appModelType=${appModelType}&readonly=${readonly}`,"deleteCondition");
				break
			case "I0105":
				modifyCondition.parentNode.removeChild(modifyCondition);
				deleteCondition.parentNode.removeChild(deleteCondition);
				addTab("查询条件",`IsrvCondInfoList.html?appId=${appId}&appModelId=${appModelId}&appModelType=${appModelType}&readonly=${readonly}`,"queryCondition");
				addTab("数据清洗",`IsrvTranInfoList.html?appId=${appId}&appModelId=${appModelId}&appModelType=${appModelType}&readonly=${readonly}`,"dataCleaning");
				break
		}
		addTab("输出参数",`IsrvOutInfoList.html?appId=${appId}&appModelId=${appModelId}&appModelType=${appModelType}&readonly=${readonly}`,"outputParameter");
	}


	$(function() {
		//使用javascript初始化
		$('#title').text(packageName+"-"+appModelName+"-"+appModelTypeName);
		optionControl(appModelType);

	});
</script>
